<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./http2.js"></script>
</head>
<body>
    <script>
        let obj={
            name:"小车车"
        }
        // get请求
        http.get('http://139.9.177.51:3333/api/testGet',obj,function(res){
            console.log(res);
        })
        // post请求
        http.post('http://139.9.177.51:3333/api/testPost',obj,function(res){
            console.log(res);
        })
        // ajax万能请求 get
        http.ajax({
            type:"get",
            url:'http://139.9.177.51:3333/api/testGet',
            data:obj,
            sucess:function(res){
                console.log(res);
            }
        })
        // ajax万能请求 post
        http.ajax({
            type:"post",
            url:'http://139.9.177.51:3333/api/testPost',
            data:obj,
            sucess:function(res){
                console.log(res);
            }
        })
    </script>
    
</body>
</html>